INCLUDE(srcs.cmake)

ADD_LIBRARY(sysutils_static_glibc STATIC ${LIBSYSUTILS_SRCS})
ADD_LIBRARY(sysutils_shared_glibc SHARED ${LIBSYSUTILS_SRCS})
ADD_LIBRARY(sysutils_static_uclibc STATIC ${LIBSYSUTILS_SRCS})
ADD_LIBRARY(sysutils_shared_uclibc SHARED ${LIBSYSUTILS_SRCS})

SET_TARGET_PROPERTIES(sysutils_static_glibc PROPERTIES
    OUTPUT_NAME "sysutils"
    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib-glibc
)

SET_TARGET_PROPERTIES(sysutils_shared_glibc PROPERTIES
    OUTPUT_NAME "sysutils"
    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib-glibc
)

SET_TARGET_PROPERTIES(sysutils_static_uclibc PROPERTIES
    OUTPUT_NAME "sysutils"
    LINK_FLAGS "-muclibc"
    COMPILE_FLAGS "-muclibc"
    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib-uclibc
)

SET_TARGET_PROPERTIES(sysutils_shared_uclibc PROPERTIES
    OUTPUT_NAME "sysutils"
    LINK_FLAGS "-muclibc"
    COMPILE_FLAGS "-muclibc"
    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib-uclibc
)

INSTALL(TARGETS sysutils_static_glibc sysutils_shared_glibc
    ARCHIVE DESTINATION ${LIB_INSTALL_DIR_GLIBC}
    LIBRARY DESTINATION ${LIB_INSTALL_DIR_GLIBC}
)

INSTALL(TARGETS sysutils_static_uclibc sysutils_shared_uclibc
    ARCHIVE DESTINATION ${LIB_INSTALL_DIR_UCLIBC}
    LIBRARY DESTINATION ${LIB_INSTALL_DIR_UCLIBC}
)
